﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _3_1_Process
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = 1, y = 2, z = 3;
            x += y += z;
            Console.WriteLine(x + "  " + y + "   " + z);
            Console.WriteLine(x<y? y :x );
            Console.WriteLine(x + "  " + y + "   " + z);
            Console.WriteLine(x < y ? x++ : y);
            Console.WriteLine(x + "  " + y + "   " + z);
            z += x > y ? x++ : y++;
            Console.WriteLine(x + "  " + y + "   " + z);
            x = 3;
            y = z = 4;
            Console.WriteLine(x + "  " + y + "   " + z);

            Console.ReadKey();
            //三目运算符
            int aaa = 1, bbb = 2, ccc = 5, ddd = 4;
            int max = (aaa > bbb) ? aaa : (ccc > bbb ? ccc : (ddd > bbb? ddd : bbb));

            if (aaa > bbb)
                max = aaa;
            else
            {
                if (ccc > bbb)
                    max = ccc;
                else
                {
                    if (ddd > bbb)
                        max = ddd;
                    else
                        max = bbb;
                }
            }
            //输入2个数按照从下到大输出
            string con = "";
            do
            {
                Console.WriteLine("Please Enter a Num:");
                float f1;
                while (!float.TryParse(Console.ReadLine(), out f1))
                {
                    Console.WriteLine("Input Error! Please Enter a Num:");
                }

                Console.WriteLine("Please Enter anthor Num:");
                float f2;
                while (!float.TryParse(Console.ReadLine(), out f2))
                {
                    Console.WriteLine("Input Error! Please Enter anthor Num:");
                }

                if (f1 > f2)
                    Console.WriteLine(f2 + "    " + f1);
                else
                    Console.WriteLine(f1 + "    " + f2);
                Console.WriteLine("是否继续？（Y/N）");
                con = Console.ReadLine();
            }while(con == "Y" || con == "y");
            

            int a = 4, b = 3;
            if (a > b) a = 5;

            if (a > 3)
            {
                Console.WriteLine(a > b);
            }
            else if (a > 2)
            {
                Console.WriteLine(a > b);
            }
            else
            {
                if (true)

                {

                }
                else
                {

                }
            }

            //

            Console.ReadKey();
        }
    }
}
